package org.example.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.example.service.TestService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author shiqi
 * @version 1.0.0
 * @ClassName HelloController.java
 * @Description
 * @createTime 2024-07-23
 */
@RestController
@RequestMapping("/test")
@Tag(name = "test")
@Slf4j
public class HelloController {

    @Resource
    private TestService testService;

    @Operation(summary = "测试接口1", description = "hello xxx")
    @GetMapping("/echo")
    public String echo(@RequestParam String name) {
        testService.testRefresh();
        return "Hello:" + name;
    }
}
